<template>
	<view class="u-page">
		<view class="">
			<u-list @scrolltolower="scrolltolower">
				<u-list-item v-for="(item, index) in indexList" :key="index">
					<view
						style="height: 200rpx;background-color:#fff;margin:10upx 40upx 10upx;padding: 20upx;border-radius: 3%;"
						@click="goXiangqing">
						<u-row customStyle="height:100%">
							<u-col span="4">
								<view class="" style="height: 100%;">
									<u-image
										src="https://img2.baidu.com/it/u=4136404846,3323025248&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=1084"
										width="200rpx" height="160rpx"></u-image>
								</view>
							</u-col>
							<u-col span="8" align="center">
								<u-row customStyle="margin-bottom:10px">
									<view class="">
										全国古玩城线上线下一体化
									</view>
								</u-row>
								<u-row>
									<view class="">
										2024-08-26 20:45:54
									</view>
								</u-row>
							</u-col>
						</u-row>
					</view>
				</u-list-item>
			</u-list>
		</view>
		<view class="" style="margin-top: 200rpx;">

		</view>
		<view class=""
			style="position: fixed;bottom:0px;width: 100%;height: 180rpx; border-top: #555555 solid 1rpx; background-color: #fff;">
			<u-row gutter="10" customStyle="height:100%">
				<u-col span="6" align="center" justify="center">
					<view style="margin: 0 20rpx 0;">
						<u-button type="primary" shape="circle" text="我的投放" size="large" :plain="true"
							@click="goMytoufang"></u-button>
					</view>
				</u-col>
				<u-col span="6">
					<view style="margin: 0 20rpx 0;">
						<u-button type="primary" shape="circle" text="申请广告入驻" size="large"
							@click="goGuanggaoRuzhu"></u-button>
					</view>
				</u-col>
			</u-row>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				indexList: [],
				urls: [
					'https://cdn.uviewui.com/uview/album/1.jpg',
					'https://cdn.uviewui.com/uview/album/2.jpg',
					'https://cdn.uviewui.com/uview/album/3.jpg',
					'https://cdn.uviewui.com/uview/album/4.jpg',
					'https://cdn.uviewui.com/uview/album/5.jpg',
					'https://cdn.uviewui.com/uview/album/6.jpg',
					'https://cdn.uviewui.com/uview/album/7.jpg',
					'https://cdn.uviewui.com/uview/album/8.jpg',
					'https://cdn.uviewui.com/uview/album/9.jpg',
					'https://cdn.uviewui.com/uview/album/10.jpg',
				]
			}
		},
		onLoad() {
			this.loadmore()
		},
		methods: {
			// 广告入驻
			goGuanggaoRuzhu() {
				uni.navigateTo({
					url: '/moduleA/guanggaoruzhu/guanggaoruzhu'
				})
			},
			// 我的投放
			goMytoufang() {
				uni.navigateTo({
					url: '/moduleA/toufang/toufang'
				})
			},
			// 广告详情页
			goXiangqing() {
				uni.navigateTo({
					url: '/moduleA/guanggaoxiangqing/guanggaoxiangqing'
				})
			},
			scrolltolower() {
				this.loadmore()
			},
			loadmore() {
				for (let i = 0; i < 30; i++) {
					this.indexList.push({
						url: this.urls[uni.$u.random(0, this.urls.length - 1)]
					})
				}
			}
		},
	}
</script>